package com.tansun.easycare.rule.rulegroup.entity;

import org.hibernate.validator.constraints.Length;

import com.tansun.easycare.rule.common.entity.RuleBaseEntity;

/**
 * 规则/政策规规则Entity
 *
 * @author lixs
 * @version 2017-04-26
 */
public class RuleGroup extends RuleBaseEntity<RuleGroup> implements Comparable<RuleGroup> {

    private static final long serialVersionUID = 1L;
    private String ruleName;        // 规则名
    private String groupCode;		//集合编码
    private String manageId;        // manage_id
    private String projectCode;        // 规则库编码
    private String version;        // 版本号
    private Integer sort;        // 排序
    private Integer salience;        // 优先级
    private String comment;        // 规则注释
    private String txtType;        // 规则内容组织类型
    private String enabled;        // 是否生效
    private String dateEffective;        // 规则开始生效日期
    private String dateExpires;        // 规则过期日期
    private String activationGroup;        // 互斥组标记
    private String facts;        // 变量定义

    private String evals;        // 条件判断
    private String actions;        // 规则动作
    private String elseActions;        // 其他规则动作，否则
    private Integer seq;        // 序号

    private String status;
    private String ruleweight;  //规则权重
    private String refId;
    
    private String priority;  //优先级
    private String reasonCode;
    private String entryId;
    private int ruleScore;
    
    public RuleGroup() {
        super();
    }

    public RuleGroup(String id) {
        super(id);
    }

    @Length(min = 0, max = 100, message = "规则名长度必须介于 0 和 100 之间")
    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    @Length(min = 0, max = 64, message = "manage_id长度必须介于 0 和 64 之间")
    public String getManageId() {
        return manageId;
    }

    public void setManageId(String manageId) {
        this.manageId = manageId;
    }

    @Length(min = 0, max = 50, message = "规则库编码长度必须介于 0 和 50 之间")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    @Length(min = 0, max = 50, message = "版本号长度必须介于 0 和 50 之间")
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }


    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getSalience() {
        return salience;
    }

    public void setSalience(Integer salience) {
        this.salience = salience;
    }

    @Length(min = 0, max = 100, message = "规则注释长度必须介于 0 和 100 之间")
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Length(min = 0, max = 10, message = "规则内容组织类型长度必须介于 0 和 10 之间")
    public String getTxtType() {
        return txtType;
    }

    public void setTxtType(String txtType) {
        this.txtType = txtType;
    }

    @Length(min = 0, max = 10, message = "是否生效长度必须介于 0 和 10 之间")
    public String getEnabled() {
        return enabled;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    @Length(min = 0, max = 50, message = "规则开始生效日期长度必须介于 0 和 50 之间")
    public String getDateEffective() {
        return dateEffective;
    }

    public void setDateEffective(String dateEffective) {
        this.dateEffective = dateEffective;
    }

    @Length(min = 0, max = 50, message = "规则过期日期长度必须介于 0 和 50 之间")
    public String getDateExpires() {
        return dateExpires;
    }

    public void setDateExpires(String dateExpires) {
        this.dateExpires = dateExpires;
    }

    @Length(min = 0, max = 50, message = "互斥组标记长度必须介于 0 和 50 之间")
    public String getActivationGroup() {
        return activationGroup;
    }

    public void setActivationGroup(String activationGroup) {
        this.activationGroup = activationGroup;
    }

    @Length(min = 0, max = 4000, message = "变量定义长度必须介于 0 和 4000 之间")
    public String getFacts() {
        return facts;
    }

    public void setFacts(String facts) {
        this.facts = facts;
    }

    @Length(min = 0, max = 4000, message = "条件判断长度必须介于 0 和 4000 之间")
    public String getEvals() {

        return evals;
    }

    public void setEvals(String evals) {
        this.evals = evals;
    }

    @Length(min = 0, max = 4000, message = "规则动作长度必须介于 0 和 4000 之间")
    public String getActions() {

        return actions;
    }

    public void setActions(String actions) {
        this.actions = actions;
    }

    @Length(min = 0, max = 11, message = "序号长度必须介于 0 和 11 之间")


    @Override
    public int compareTo(RuleGroup arg0) {
        return this.getSort().compareTo(arg0.getSort()) * -1;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getTmpEvals() {
        return this.evals;
    }

    public String getTmpActions() {
        return this.actions;
    }

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getGroupCode() {
		return groupCode;
	}

	public void setGroupCode(String groupCode) {
		this.groupCode = groupCode;
	}

	public String getRuleweight() {
		return ruleweight;
	}

	public void setRuleweight(String ruleweight) {
		this.ruleweight = ruleweight;
	}

	public String getRefId() {
		return refId;
	}

	public void setRefId(String refId) {
		this.refId = refId;
	}

	public String getReasonCode() {
		return reasonCode;
	}

	public void setReasonCode(String reasonCode) {
		this.reasonCode = reasonCode;
	}

	public String getEntryId() {
		return entryId;
	}

	public void setEntryId(String entryId) {
		this.entryId = entryId;
	}

	public int getRuleScore() {
		return ruleScore;
	}

	public void setRuleScore(int ruleScore) {
		this.ruleScore = ruleScore;
	}

	public String getPriority() {
		return priority;
	}

	public void setPriority(String priority) {
		this.priority = priority;
	}

	public String getElseActions() {
		return elseActions;
	}

	public void setElseActions(String elseActions) {
		this.elseActions = elseActions;
	}
	
	
}